set camera width and height opencv python

26

import cv2

cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH,1200)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT,720)

#BTW
#cv2.CAP_PROP_FRAME_WIDTH=3
#cv2.CAP_PROP_FRAME_HEIGHT=4
#You can change them to those values If you want to.

Comments

Submit
0 Comments